﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AddonNice.CRMWrapper
{
    /// <summary>
    /// CrmDynAttribute is used to mark attribute properties in DynEntities
    /// </summary>
    [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
    public class CrmDynAttribute : Attribute 
    {
        //Private fields.
        private string _Entity;
        private string _Version  =   "all";

        public CrmDynAttribute(string ent, string ver)
        {
            _Entity  =   ent;
            _Version =   ver;
        }

        public CrmDynAttribute(string ent)
        {
            _Entity  =   ent;
        }

        /// <summary>
        /// The entity name
        /// </summary>
        public string Entity
        {
            get {return _Entity;}
            set {_Entity = value;}
        }

        /// <summary>
        /// The version of Entity
        /// </summary>
        public string Version
        {
            get {return _Version;}
            set {_Version = value;}
        }
    }
}
